package com.totoro.spring.spring_demo.aop.declare_parents;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.DeclareParents;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * 现在通过AOP，帮助空调增加新的功能-——制热
 * Created by Niki on 2018/6/19 9:14
 */
@Aspect
@Component
public class ConditionAOP {

    @Pointcut("execution(* com.totoro.spring.spring_demo.aop.declare_parents.AirCondition.refrigeration(..))")
    public void pointcut(){}

//    @DeclareParents(value = "com.totoro.spring.spring_demo.aop.declare_parents.AirCondition+", defaultImpl = GeliHotCondition.class)
    public HotAirCondition hotAirCondition;

    @Before("pointcut()")
    public void deal(){
        System.out.println("前置处理！");
    }

}
